<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>注册--我是博客系统</title>
</head>
<body>

<script src="/static/js/vue.min.js"></script>
<script src="/static/js/axios.min.js"></script>
<link rel="stylesheet" href="/static/js/reset.min.css" />
<link rel="stylesheet" href="/static/element/index.css" />
<script src="/static/element/index.js"></script>
<div id="app">
    <div style="width: 520px;margin:  0px auto;margin-top: 20px;">
        <el-form :model="formData">
            <el-form-item label="用户">
                <el-input v-model="formData.userName"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input v-model="formData.passWord"></el-input>
            </el-form-item>
            <el-form-item >
                <el-button type="primary" @click="triggerRegister">注册</el-button>
            </el-form-item>
        </el-form>
    </div>

</div>
<script>
    new Vue({
        el:"#app",
        data(){
            return {
                formData:{
                    userName:"",
                    passWord:""
                }
            }
        },
        methods:{
            triggerRegister(){
                axios.post("/register",{...this.formData}).then(res=>res.data)
                    .then(res=>{
                    })
            },
        }
    })

</script>
</body>
</html>